package com.main.springannotation.srpingprint;

import com.main.springannotation.C.CC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Component;

/**
 * Created by admin on 2017/5/1.
 */
@Component
public class SpringPrint {
    @Autowired
    private CC cc;
    public void getSpring(){
        cc.print();
    }
    public void getC(){
        cc.printC();
    }
    public void getDriverClass(){
       cc.getDriverClass();
    }
    public static void main(String[] args) {
        ApplicationContext ap = new ClassPathXmlApplicationContext("com/main/springannotation/SpringAnnotation.xml");
        SpringPrint sp = ap.getBean(SpringPrint.class);
        sp.getSpring();
        sp.getC();
        sp.getDriverClass();
    }
}
